package com.bdqn.dao;

import com.bdqn.pojo.SysUser;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class SysUserMapperImpl implements SysUserMapper{
    // mybatis-spring包中提供的实现了SqlSession接口的类，用来操作数据库
    private SqlSessionTemplate sqlSession;
    @Override
    public List<SysUser> selectSysUserList(SysUser sysUser) {
        return sqlSession.getMapper(SysUserMapper.class).selectSysUserList(sysUser);
    }

    @Override
    public int add(SysUser sysUser) {
        return sqlSession.getMapper(SysUserMapper.class).add(sysUser);
    }

    @Override
    public int delete(SysUser sysUser) {
        return sqlSession.getMapper(SysUserMapper.class).delete(sysUser);
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }
}
